<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------
namespace api\user\controller;

use cmf\controller\RestBaseController;
use think\Db;
use think\Validate;
//下拉框控制器 获取所有下拉框表的
class selectController extends RestBaseController
{
    // 获取企业注册登记表关联的 所有下拉框分表的;
    public function getRegisterSelect($private = null)
    {

        // 先查外资国别表 register_foreign
        $register_foreign = Db::name('register_foreign')->select()->toArray();

        $allSelect['register_foreign'] = $register_foreign;

        // 查所属行业表 register_industry
        $register_industry = Db::name('register_industry')->select()->toArray();

        $allSelect['register_industry'] = $register_industry;

        // 查企业规模表 register_scale
        $register_scale = Db::name('register_scale')->select()->toArray();

        $allSelect['register_scale'] = $register_scale;

        //企业所得税机关表 register_revenue
        $register_revenue = Db::name('register_revenue')->select()->toArray();

        $allSelect['register_revenue'] = $register_revenue;

        //企业税征收方式表 register_colllection
        $register_colllection = Db::name('register_colllection')->select()->toArray();

        $allSelect['register_colllection'] = $register_colllection;

        //公民类型表 register_civics_type
        $register_civics_type = Db::name('register_civics_type')->select()->toArray();

        $allSelect['register_civics_type'] = $register_civics_type;

        //法人类型表 register_legal_type
        $register_legal_type = Db::name('register_legal_type')->select()->toArray();

        $allSelect['register_legal_type'] = $register_legal_type;

        if ($private) {
            return $allSelect;
        }
        $this->success("获取企业注册表下拉框成功!", $allSelect);




    }

    // 获取项目公司名字 project_company_name的分表的下拉框;
    public function getCompanyNameSelect($private = null)
    {
        //法人类型表 $project_company_name
        $project_company_name = Db::name('project_company_name')->select()->toArray();

        $allSelect['register_legal_type'] = $project_company_name;
        if ($private) {
            return $project_company_name;
        }
        $this->success("获取企业名字表下拉框成功!", $project_company_name);
    }

    //  获取知识产权汇总表关联的 所有下拉框分表的;
    public function getKnowledgeSelect($private = null)
    {

        $knowledge_info_type_name = Db::name('knowledge_info_type')->select()->toArray();

        $allSelect['knowledge_info_type'] = $knowledge_info_type_name;

        $knowledge_condition_level_name = Db::name('knowledge_condition_level')->select()->toArray();

        $allSelect['knowledge_condition_level'] = $knowledge_condition_level_name;

        if ($private) {
            return $allSelect;
        }

        $this->success("获取知识产权汇总表表下拉框成功!", $allSelect);

     }


}
